]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
osdWindow: Ensure we setMaxLevel before setting Level itself
authorDidier Roche <didrocks@ubuntu.com>
Thu, 18 Oct 2018 15:26:03 +0000 (17:26 +0200)
committerDidier Roche <didrocks@ubuntu.com>
Fri, 19 Oct 2018 14:18:41 +0000 (16:18 +0200)
When maxLevel is > 100%, first OSD appearance was capping the current
level to 100%. Consecutives key press were then OK.
Ensure we setMaxLevel before setting Level itself, so that correct cap
value is applied.

js/ui/osdWindow.js

index 9021c22d2c6fe492327c0689232506fe2a9fe45a..fb6587be0136c65ab70db0db24735c86a83cfe65 100644 (file)
@@ -204,8 +204,8 @@ var OsdWindow = new Lang.Class({
     _reset() {
         this.actor.hide();
         this.setLabel(null);
-        this.setLevel(null);
         this.setMaxLevel(null);
+        this.setLevel(null);
     },
 
     _relayout() {
@@ -253,8 +253,8 @@ var OsdWindowManager = new Lang.Class({
     _showOsdWindow(monitorIndex, icon, label, level, maxLevel) {
         this._osdWindows[monitorIndex].setIcon(icon);
         this._osdWindows[monitorIndex].setLabel(label);
-        this._osdWindows[monitorIndex].setLevel(level);
         this._osdWindows[monitorIndex].setMaxLevel(maxLevel);
+        this._osdWindows[monitorIndex].setLevel(level);
         this._osdWindows[monitorIndex].show();
     },